<template>
  <div></div>
</template>

<script>
  export default {
    name: 'Home',
    data() {
      return {
        show: false
      }
    },
    mounted() {
      this.gotoAuth()
    },
    methods: {
      gotoAuth(){
        const IS_PROD = true || ['production', 'prod'].includes(process.env.NODE_ENV)
        const appid = 'wx7d428de111b91a1b'
        // const redirect_uri = 'https://zg.7ioe.cn:8858/open/wx/auth/code'
        const redirect_uri = IS_PROD?'https://zg.7ioe.cn/api/open/wx/auth/code':'https://zg.7ioe.cn/test/api/open/wx/auth/code'
        const state = process.env.NODE_ENV==='production'?'https://zg.7ioe.cn/wexin/#/home':'http://localhost:9020/wexin/#/home'
        // const state = 'http://localhost:9020/wexin/#/home'
        window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(redirect_uri)}&response_type=code&scope=snsapi_userinfo&state=${encodeURIComponent(state)}#wechat_redirect`
      },
    }
  }
</script>


